
<script language="javascript" src="{{$s_path}}/ueditor/ueditor.config.js"></script>
<script language="javascript" src="{{$s_path}}/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{{$s_path}}/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="{{$s_path}}/js/uploadify.js" ></script>

<script type="text/javascript" src="{{$s_path}}/js/goods.js"></script>
<script type="text/javascript" src="{{$s_path}}/js/debug.js"></script>

<style>
.user_add {
    float: left;
    overflow: hidden;
    width: auto;
}
.user_add table {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #E0DFDF;
    border-collapse: collapse;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    float: left;
    height: auto;
    line-height: 20px;
    text-align: center;
    width: auto;
}
 .user_add h1.htitle {
   
    color: #2F79F2;
    font-family: 微软雅黑;
    font-weight: 100;
    line-height: 35px;
    margin: 0 0 10px;
    padding: 0 0 5px;
}
.user_add table tr td {
    border: 1px solid #E0DFDF;
    padding: 5px;
}
.user_add table strong {
    color: #15AA8F;
    display: block;
    width: 120px;
}
.user_add table tr td {
    border: 1px solid #E0DFDF;
    padding: 5px;
}
.up_img {
    float: left;
    margin: 0;
    width: 360px;
}
.video_add #video {
    color: #535353;
    letter-spacing: -0.05em;
}
.up_img .uploadify-button {
   
    border-radius: 0 0 0 0;
    color: #444444;
    float: left;
    font-weight: 100;
    height: 33px;
    margin: 0;
    text-align: left;
    text-indent: 5px;
    width: 380px;
}
.up_img .uploadify-queue {
    width: 508px;
}
.user_add table select {
    border: 1px solid #DBD9D9;
    height: 25px;
    line-height: 25px;
    width: 700px;
}
.user_add table input[type="text"] {
    border: 1px solid #DBD9D9;
    height: 25px;
    line-height: 25px;
    width: 700px;
}
.video_add textarea {
    border: 1px solid #EEECEC;
    height: 87px;
    margin: 0 0 10px;
    width: 700px;
}
.files .del_file{float:left; }
.files  span.ori{float:left; clear:both}
</style>
<script>


var file_names = ''

$(function() {
	
	
	
	var img_type = '';
	var img_limit = 10;
	var img_size  = 1;
	var obj = $("input[name=goods_name]");
  	var goods_name = obj.val();
	
	
	Main.uploadInit('#file',sep+'/ajax.php?act=goods_img_upload&name='+goods_name,true,img_limit,img_type,img_size);
	
})

</script> 

<div class="user_add video_add">
<form action="admins.php" method="post" class="goods_edit">
  <table>
    <caption>
    <h1 class="htitle">商品编辑</h1>
    </caption>
    <tr>
      <td><strong>商品名</strong></td>
      <td><input type="text" name="goods_name" value="{{$goods.goods_name}}"/></td>
    </tr>
    <tr>
      <td><strong>货号</strong></td>
      <td><input type="text" name="goods_sn" value="{{$goods.goods_sn}}"/></td>
    </tr>
    <tr>
      <td><strong>市场价</strong></td>
      <td><input type="text" name="market_price" value="{{$goods.market_price}}"/></td>
    </tr>
     <tr>
      <td><strong>本店价</strong></td>
      <td><input type="text" name="shop_price" value="{{$goods.shop_price}}"/></td>
    </tr>
    <tr>
      <td class="widtha"><strong>分类</strong></td>
      <td class="types"><select name="cat_id">
          <option value="">请选择</option>
          
       {{foreach from=$categories item=list key=key}}
        
          <option value="{{$list.cat_id}}" {{if $cat_id==$list.cat_id}}selected="selected"{{/if}}>{{$list.cat_name}}</option>
          
         {{foreach from=$list.children item=s_v key=s_k}}
          
          <option value="{{$s_v.cat_id}}" {{if $cat_id==$s_v.cat_id}}selected="selected"{{/if}}>┗ {{$s_v.cat_name}}</option>
           {{foreach from=$s_v.children item=ss_v key=s_sk}}
          
          <option value="{{$ss_v.cat_id}}" {{if $cat_id==$ss_v.cat_id}}selected="selected"{{/if}}>&nbsp;┗▂ {{$ss_v.cat_name}}</option>
          
           {{/foreach}}
          
         {{/foreach}}
      {{/foreach}}
      
        
        </select></td>
    </tr>
    <tr>
      <td><strong>商品图片</strong></td>
      <td  align="left" position="relative"><div id="file">
        </div>
        <div id="file_res">
        {{foreach from=$goods.gallery item=list key=key}}
        
        <div class="files file_{{$key}}"><a><img height="60" name="{{$list.img}}" src="{{$sep}}/{{$list.img}}"></a> <img onclick="Main.delFile({{$key}})" title="Delete" class="del_file" src="{{$sep}}/includes/static/images/uploadify-cancel.gif"><span class="ori">封面图<input type="radio" name="original"  onclick="asOriginal('{{$list.img}}','{{$goods.goods_id}}')" {{if $list.img && ! $list.img_id}} checked="checked"{{/if}}/></span> </div>
        {{/foreach}}
        </div>
        <input type="hidden" value="{{foreach from=$goods.gallery item=list key=key}}{{$list.img_original}}|||{{/foreach}}" name="imgs"/>
        </td>
    </tr>
    <tr>
      <td><strong>Size</strong></td>
      <td  align="left"><input type="text"  name="attr[size]" value="{{foreach from=$attrs.size item=list key=k}}{{$list.attr_value}}#{{$list.attr_price}}|{{/foreach}}"/></td>
    </tr>
    <tr>
      <td><strong>Color</strong></td>
      <td  align="left"><input type="text"  name="attr[color]" value="{{foreach from=$attrs.color item=list key=k}}{{$list.attr_value}}#{{$list.attr_price}}|{{/foreach}}"/></td>
    </tr>
    <tr>
      <td><strong>Style</strong></td>
      <td  align="left"><input type="text"  name="attr[style]" value="{{foreach from=$attrs.style item=list key=k}}{{$list.attr_value}}#{{$list.attr_price}}|{{/foreach}}"/></td>
    </tr>
    <tr>
      <td><strong>Select</strong></td>
      <td  align="left"><input type="text"  name="attr[select]" value="{{foreach from=$attrs.select item=list key=k}}{{$list.attr_value}}#{{$list.attr_price}}|{{/foreach}}"/></td>
    </tr>
    <tr>
      <td><strong>描述</strong></td>
      <td style="width:700px"><textarea name="goods_desc" id="goods_desc"  style="height:400px;">
        {{$goods.goods_desc}}
        </textarea></td>
        <script>
        	UE.getEditor('goods_desc');
        </script>
    </tr>
    <tr>
      <td><strong>descs</strong></td>
      <td><textarea name="descs"/>
        {{$goods.descs1}}
        </textarea></td>
    </tr>
    <tr>
      <td><strong>是否显示</strong></td>
      <td><span class="mawidt">是
        <input type="radio" value="0" name="is_delete" {{if $goods.is_delete==0}}checked="checked"{{/if}}/>
        </span> <span class="mawidt">否
        <input type="radio" value="1" name="is_delete" {{if $goods.is_delete==1}}checked="checked"{{/if}}/>
        </span></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><input type="hidden" name="goods_id" value="{{$goods.goods_id}}"/>
      <input type="hidden" name="act" value="goods_edit"/>
        <input type="button" class="btn_jq" onclick="GS.goodsEdit(this.form)" value="保存"/></td>
    </tr>
  </table>
  
  </form>

</div>
